<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="file_admin" :rules="rules" label-width="100px" id="mvcfm">
      <el-button @click="productProTechAddSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
      <el-button @click="gotoPage('/mes/product/ProductProTech?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>取消</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 文件说明 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="12">
            <el-form-item label="文件名称" prop="file_name">
              <el-input v-model="file_admin.file_name" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="文件编号" prop="file_num">
              <el-input v-model="file_admin.file_num" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="文件受控状态" prop="file_confet">
              <el-radio-group v-model="file_admin.file_confet">
                <el-radio-button label="受控">受控</el-radio-button>
                <el-radio-button label="不受控">不受控</el-radio-button>
              </el-radio-group>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="编写人" prop="file_comperson">
              <el-select style='width:100%' v-model="file_admin.file_comperson">
                <el-option label="1" value="1" />
                <el-option label="2" value="2" />
                <el-option label="3" value="3" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="编写时间" prop="file_comdate">
              <el-date-picker v-model="file_admin.file_comdate" type="date" style='width:100%' value-format="yyyy-MM-dd" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="审核人" prop="file_verify">
              <el-select style='width:100%' v-model="file_admin.file_verify">
                <el-option label="1" value="1" />
                <el-option label="2" value="2" />
                <el-option label="3" value="3" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="审核时间" prop="file_verifydate">
              <el-date-picker v-model="file_admin.file_verifydate" type="date" style='width:100%' value-format="yyyy-MM-dd" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="审核意见" prop="file_verifydes">
              <el-input type="textarea" v-model="file_admin.file_verifydes" ttparea=350></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="批准人" prop="file_approver">
              <el-input v-model="file_admin.file_approver" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="批准时间" prop="file_apodate">
              <el-date-picker v-model="file_admin.file_apodate" type="date" style='width:100%' value-format="yyyy-MM-dd" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="批准意见" prop="file_apodes">
              <el-input type="textarea" v-model="file_admin.file_apodes" ttparea=350></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="发布时间" prop="file_comdate">
              <el-date-picker v-model="file_admin.file_comdate" type="date" style='width:100%' value-format="yyyy-MM-dd" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="文件内容" prop="file_des">
              <el-input type="textarea" v-model="file_admin.file_des" ttparea=350></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <input type=file />
          </el-col>
        </el-row>
      </div>
      <el-button @click="productProTechAddSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
      <el-button @click="gotoPage('/mes/product/ProductProTech?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>取消</el-button>
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'ProductProTechAdd',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        file_admin: {
          file_name: null,
          file_num: null,
          file_confet: null,
          file_comperson: null,
          file_comdate: null,
          file_verify: null,
          file_verifydate: null,
          file_verifydes: null,
          file_approver: null,
          file_apodate: null,
          file_apodes: null,
          file_comdate: null,
          file_des: null,
        },
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/mes/product/ProcedureAction/productProTechAdd?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      productProTechAddSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/mes/product/ProcedureAction/productProTechAddSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.gotoPage("/mes/product/ProductProTech/productProTech?" + this.vueparams, data);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
